FROM openjdk:8-jdk-slim

# 替换镜像源，安装python3
RUN sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
    && sed -i 's/security.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list \
    && apt-get update \
    && apt-get install -y iputils-ping telnet curl procps \
    && apt-get install -y python3 \
    && ln -s /usr/bin/python3 /usr/bin/python \
    && apt-get clean

ENV TZ=PRC
ENV MODULE=datax-admin
ENV DB_HOST=mysql DB_PORT=3306 DB_DATABASE=datax_web DB_USERNAME=root DB_PASSWORD=root
ENV ADMIN_ADDRESS=127.0.0.1:9527 DATAX_HOME=/opt/datax/bin
WORKDIR /opt
COPY build/datax ./datax
COPY build/datax-web-2.1.2 ./datax-web-2.1.2
COPY start.sh .

# 安装datax-web
RUN ./datax-web-2.1.2/bin/install.sh --force \
    && rm -rf datax-web-2.1.2/packages

# datax-admin[9527]
EXPOSE 9527
# datax-executor[9999]
#EXPOSE 9999

CMD sh /opt/start.sh